const http = require("http");

const server = http.createServer((request, response) => {
  //文字编码显示
  response.setHeader("content-type", "text/html;charset=utf-8");

  let url = new URL(request.url, "http://127.0.0.1:9000");
  console.log(url);
  console.log(url.searchParams.get('keyword'));
  response.end("你好");
});

//http://127.0.0.1:9000/ , 终端本地 node guide.js
server.listen(9000, () => {
  console.log("服务已启动");
});
